package com.farmer.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OssClientConfig {
    @Value("https://oss-cn-chengdu.aliyuncs.com")
    private String endpoint;

    @Value("LTAI5tQVgA7RmRaRwSKQBbD4")
    private String accessKeyId;

    @Value("rOEgRdaMwNp3dxNywv3tSjulXldBCq")
    private String accessKeySecret;

    @Bean
    public OSS ossClient() {
        return new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
    }
}
